//
//  ZDDEmoticonKeyboard.swift
//  小蜗牛_新浪微博
//
//  Created by 周冬冬 on 16/7/4.
//  Copyright © 2016年 我的mac. All rights reserved.
//

import UIKit

class ZDDEmoticonKeyboard: UIView {

    override init(frame: CGRect) {
        super.init(frame: frame)
        setupUI()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func setupUI(){
    
    backgroundColor = UIColor(patternImage: UIImage(named: "emoticon_keyboard_background")!)
    
        //添加控件
        addSubview(toolBar)
        addSubview(pageView)
        //添加约束
        toolBar.snp_makeConstraints { (make) -> Void in
            make.leading.trailing.bottom.equalTo(self)
            make.height.equalTo(37)
        }
        pageView.snp_makeConstraints { (make) -> Void in
            make.top.leading.trailing.equalTo(self)
            make.bottom.equalTo(toolBar.snp_top)
        }
        
    }
    
    
    private lazy var toolBar:ZDDEmoticonToolbar = ZDDEmoticonToolbar(frame:CGRectZero)
    //表情
    private lazy var pageView:ZDDEmoticonPageView = {
    
        let view = ZDDEmoticonPageView()
        view.bounces = false
        //分页
        view.pagingEnabled = true
        //隐藏滚动条
        view.showsHorizontalScrollIndicator = false
        view.showsVerticalScrollIndicator = false
        return view
    
    }()
    
}



















